package com.itcast.demo02.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * 统一Bean的后置处理器
 **/
public class MyBeanProccor implements BeanPostProcessor {

    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        // beanName    bean的对象实例
        System.out.println("第五步执行初始化之前执行的方法==>" + s);
        return o;
    }

    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        System.out.println("第八步执行初始化之后执行的方法==>" + s);
        return o;
    }
}
